<?php
namespace app\know\validate;

use app\know\model\QuestionModel;
use think\Validate;
use think\facade\Log;

class QuestionValidate extends Validate
{
    protected $rule = [
        'subject_code' => 'require|min:1',
        'type_code' => 'require|min:1',
        'id' => 'require|gt:0',
    ];

    protected $message = [
        'subject_code.require' => '科目为必填项',
        'subject_code.min' => '科目不能为空',
        'type_code.require' => '试题类型为必填项',
        'type_code.min' => '试题类型不能为空',
        'id.require' => 'id不能为空',
    ];

    protected $scene = [
        'add'  => ['subject_code', 'type_code'],
        'edit' => ['id', 'question_uuid'],
        'delete' => ['id'],
    ];
    
}